package com.zz.tijian.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @TableName reply
 */
@TableName(value ="reply")
@Data
@ApiModel(description = "回复信息")
public class Reply implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    private Integer id;

    /**
     * 主题ID
     */
    @ApiModelProperty(value = "主题ID", example = "1")
    private Integer topicId;

    /**
     * 回复内容
     */
    @ApiModelProperty(value = "回复内容")
    private String content;

    /**
     * 创建者
     */
    @ApiModelProperty(value = "创建者ID")
    private String userId;

    /**
     * 创建者真实姓名
     */
    @ApiModelProperty(value = "创建者真实姓名")
    private String realName;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createdTime;

    /**
     * 父级回复ID，关联到Reply表的id,如果为0则为根
     */
    @ApiModelProperty(value = "父级回复ID", example = "0")
    private Integer parentId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
